package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

class zbuz {
   private Workbook i;
   private WorksheetCollection j;
   private Worksheet k;
   private HashMap l;
   private com.aspose.cells.b.a.d.zm m = null;
   private double[] n;
   private Style o;
   private int p;
   private com.aspose.cells.b.a.b.zt q;
   private HashMap r;
   private HashMap s;
   private HashMap t;
   private HashMap u;
   private HashMap v;
   com.aspose.cells.a.d.ze a = null;
   com.aspose.cells.a.d.zei b = null;
   private zatn w;
   private ArrayList x;
   ArrayList c;
   HashMap d = new HashMap();
   HashMap e = new HashMap();
   private zafu[] y;
   private zagf[] z;
   private zagg[] A;
   private zahs[] B;
   HashMap[] f;
   private long C = 100000000L;
   boolean g = false;
   HashMap h;
   private static final com.aspose.cells.b.c.a.za D = new com.aspose.cells.b.c.a.za(new String[]{".bmp", ".emf", ".jpg", ".jpeg", ".png", ".gif", ".tif", ".tiff"});

   zbuz(Workbook var1) {
      this.i = var1;
      PdfSaveOptions var2 = null;
      if (!(var1.getSaveOptions() instanceof PdfSaveOptions)) {
         var2 = new PdfSaveOptions(var1.getSaveOptions());
         var1.a((SaveOptions)var2);
      } else {
         var2 = (PdfSaveOptions)var1.getSaveOptions();
      }

      if (var2.getCalculateFormula()) {
         boolean var3 = var1.getSettings().getCreateCalcChain();
         var1.getSettings().setCreateCalcChain(false);
         var1.calculateFormula();
         var1.getSettings().setCreateCalcChain(var3);
      }

      this.j = var1.getWorksheets();
      this.n = new double[]{1.0D, 1.0D};
      this.o = var1.getWorksheets().D();
      this.l = new HashMap();
      this.q = new com.aspose.cells.b.a.b.zt(0.0F, 0.0F);
      this.p = -(var1.getWorksheets().J() + var1.getWorksheets().I() + 2);
      this.x = new ArrayList();
      this.c = new ArrayList();
      this.u = new HashMap();
      this.t = new HashMap();
      this.v = new HashMap();
      this.s = new HashMap();
      this.y = new zafu[var1.getWorksheets().getCount()];
      this.z = new zagf[this.y.length];
      this.A = new zagg[this.y.length];
      this.B = new zahs[this.y.length];
      this.f = new HashMap[this.y.length];
      this.h = new HashMap();
   }

   private ImageFormat a(String var1, ImageOrPrintOptions var2) throws Exception {
      if (var1 == null) {
         return var2.getImageFormat();
      } else {
         String var3 = com.aspose.cells.b.a.d.zk.d(var1);
         switch(D.a(var3.toLowerCase())) {
         case 0:
            return ImageFormat.getBmp();
         case 1:
            return ImageFormat.getEmf();
         case 2:
         case 3:
            return ImageFormat.getJpeg();
         case 4:
            return ImageFormat.getPng();
         case 5:
            return ImageFormat.getGif();
         case 6:
         case 7:
            return ImageFormat.getTiff();
         default:
            return var2.getImageFormat();
         }
      }
   }

   void a(int var1, com.aspose.cells.b.a.d.zm var2, ImageOrPrintOptions var3) throws Exception {
      try {
         if (var1 < this.c.size()) {
            if (var1 >= 0 && var1 < this.c.size()) {
               var3.a(true);
            }

            if (var1 < 0) {
               var3.a(false);
            }

            this.b();
            zan var4 = (zan)this.c.get(var1);
            zao.a(var4, var2, this.a, var3);
            return;
         }
      } catch (Exception var8) {
         com.aspose.cells.a.c.zl.b(var8);
         throw new CellsException(4, var8.getMessage());
      } finally {
         this.c();
      }

   }

   void a(int var1, ImageOrPrintOptions var2, com.aspose.cells.b.a.d.zm var3) throws Exception {
      zan var5;
      if (var2.getSaveFormat() == 0) {
         ImageFormat var7 = var2.getImageFormat();
         if (var7 == ImageFormat.getEmf()) {
            this.a(var1, var3, var2);
            var3.b(0L);
            return;
         }

         com.aspose.cells.b.a.b.za var8;
         if (var7 == ImageFormat.getJpeg()) {
            var8 = this.a(var1, var2);
            if (var8 == null) {
               return;
            }

            com.aspose.cells.a.d.zbn.a(var8, var3, (long)var2.getQuality());
            var8.d();
            var5 = null;
            return;
         }

         if (var7 == ImageFormat.getBmp() || var7 == ImageFormat.getPng() || var7 == ImageFormat.getGif()) {
            var8 = this.a(var1, var2);
            if (var8 == null) {
               return;
            }

            var8.a(var3, var7);
            var3.b(0L);
            var8.d();
            var5 = null;
            return;
         }

         if (var7 == ImageFormat.getTiff()) {
            this.b(var1, var2, var3);
            return;
         }
      } else {
         if (var2.getSaveFormat() == 20) {
            com.aspose.cells.a.d.zgp var6 = new com.aspose.cells.a.d.zgp(var3);
            var6.e = var2.getChartImageType();
            var5 = (zan)this.c.get(var1);
            var6.a((com.aspose.cells.a.d.zl)var5);
            var6.a();
            var3.b(0L);
            return;
         }

         if (var2.getSaveFormat() == 22) {
            com.aspose.cells.a.d.zfp var4 = new com.aspose.cells.a.d.zfp(var2);
            var4.e = var2.getChartImageType();
            var5 = (zan)this.c.get(var1);
            var4.a(var5, var3, var2.getEmbededImageNameInSvg());
            var4.a();
            var3.b(0L);
            return;
         }

         if (var2.getSaveFormat() == 21) {
            this.b(var1, var2, var3);
            return;
         }
      }

   }

   private void b(int var1, ImageOrPrintOptions var2, com.aspose.cells.b.a.d.zm var3) throws Exception {
      zmq var4 = new zmq();
      var4.a(var3, var2, var1, this);
   }

   void a(int var1, String var2, ImageOrPrintOptions var3) throws Exception {
      com.aspose.cells.b.a.d.ze var4 = new com.aspose.cells.b.a.d.ze(var2, 2);
      this.a(var1, (ImageOrPrintOptions)var3, (com.aspose.cells.b.a.d.zm)var4);
      var4.b();
      var4.a();
   }

   boolean a(int var1, ImageOrPrintOptions var2, com.aspose.cells.b.a.b.zi var3) throws Exception {
      zan var4 = null;

      try {
         if (var1 >= this.c.size()) {
            boolean var11 = false;
            return var11;
         }

         if (var1 >= 0 && var1 < this.c.size()) {
            var2.a(true);
         }

         if (var1 < 0) {
            var2.a(false);
         }

         this.b();
         var4 = (zan)this.c.get(var1);
         var3.a(3);
         var3.a(Color.getWhite());
         var3.a((float)var2.getHorizontalResolution() / (float)this.j.L(), (float)var2.getVerticalResolution() / (float)this.j.M());
         com.aspose.cells.a.d.zat var5 = (com.aspose.cells.a.d.zat)this.a;
         var5.a((com.aspose.cells.a.d.zl)var4, (com.aspose.cells.b.a.b.zi)var3);
         var5.a();
         var3.g();
      } catch (Exception var9) {
         com.aspose.cells.a.c.zl.b(var9);
         throw new CellsException(4, var9.getMessage());
      } finally {
         this.c();
      }

      return true;
   }

   com.aspose.cells.b.a.b.za a(int var1, ImageOrPrintOptions var2) throws Exception {
      int[] var3 = new int[]{1, 1};
      com.aspose.cells.b.a.b.za var4 = null;
      zan var5 = null;

      Object var6;
      try {
         if (var1 < this.c.size()) {
            if (var1 >= 0 && var1 < this.c.size()) {
               var2.a(true);
            }

            if (var1 < 0) {
               var2.a(false);
            }

            this.b();
            var5 = (zan)this.c.get(var1);
            float var7;
            float var15;
            if (var2.h > 0 && var2.i > 0) {
               var4 = com.aspose.cells.a.d.zbn.a(var2.h, var2.i, var2.b());
               var15 = (float)((double)var2.h / (var5.g * (double)this.j.L()));
               var7 = (float)((double)var2.i / (var5.h * (double)this.j.M()));
            } else {
               var4 = com.aspose.cells.a.d.zbn.a((int)Math.ceil(var5.g * (double)var2.getHorizontalResolution()), (int)Math.ceil(var5.h * (double)var2.getVerticalResolution()), var2.b());
               var15 = (float)var2.getHorizontalResolution() / (float)this.j.L();
               var7 = (float)var2.getVerticalResolution() / (float)this.j.M();
            }

            var3[0] = var4.m().b();
            var3[1] = var4.m().c();
            com.aspose.cells.b.a.b.zi var8 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var4);
            var8.a(3);
            var8.a(var2.g);
            if (var2.getTransparent()) {
               var8.a(Color.getEmpty());
            } else {
               var8.a(Color.getWhite());
            }

            var8.a(var15, var7);
            com.aspose.cells.a.d.zat var9 = (com.aspose.cells.a.d.zat)this.a;
            var9.e = var2.getChartImageType();
            var9.a((com.aspose.cells.a.d.zl)var5, (com.aspose.cells.b.a.b.zi)var8);
            var4.a((float)var2.getHorizontalResolution(), (float)var2.getVerticalResolution());
            var9.a();
            var8.e();
            return var4;
         }

         var6 = null;
      } catch (Exception var13) {
         com.aspose.cells.a.c.zl.b(var13);
         throw new CellsException(4, var13.getMessage());
      } finally {
         this.c();
      }

      return (com.aspose.cells.b.a.b.za)var6;
   }

   boolean a(com.aspose.cells.b.a.d.zm var1, ImageOrPrintOptions var2) throws Exception {
      var2.a(false);
      ImageFormat var3 = this.a((String)null, var2);

      try {
         this.b();
         if (var3 == ImageFormat.getTiff() || var2.getSaveFormat() == 21) {
            zmq var20 = new zmq();
            var20.a(var1, var2, this.c, this);
            boolean var21 = true;
            return var21;
         }

         if (var2.getSaveFormat() == 20) {
            com.aspose.cells.a.d.zgp var19 = new com.aspose.cells.a.d.zgp(var1, var2.e());
            var19.e = var2.getChartImageType();
            int var5 = -1;

            for(int var6 = 0; var6 < this.c.size() && var6 - var2.e() < var2.f(); ++var6) {
               zan var7 = (zan)this.c.get(var6);
               if (var7.b.m() != var5 && var5 != -1) {
                  var19.b();
               }

               if (var6 % 50 == 0 && var6 != 0) {
                  com.aspose.cells.b.a.zg.a();
                  com.aspose.cells.b.a.zg.b();
               }

               try {
                  var19.a((com.aspose.cells.a.d.zl)var7);
               } catch (Exception var17) {
                  com.aspose.cells.a.c.zl.b(var17);
               }

               var5 = var7.b.m();
               this.i.l();
            }

            if (this.c.size() == 0) {
               com.aspose.cells.a.d.zm var22 = null;
               double var24 = 595.2755905511812D;
               double var9 = 841.8897637795276D;
               if (this.i != null && this.i.getWorksheets().getCount() > 0) {
                  PageSetup var11 = this.i.getWorksheets().get(0).getPageSetup();
                  double[] var12 = new double[]{var24};
                  double[] var13 = new double[]{var9};
                  zatm.a(var11, var12, var13);
                  var24 = var12[0];
                  var9 = var13[0];
                  var24 *= 72.0D;
                  var9 *= 72.0D;
               }

               var22 = new com.aspose.cells.a.d.zm((float)var24, (float)var9);
               var19.a((com.aspose.cells.a.d.zl)var22);
            }

            var19.a();
            var1.b(0L);
            boolean var23 = true;
            return var23;
         }

         if (var1 == null) {
            boolean var4 = false;
            return var4;
         }
      } finally {
         this.c();
      }

      return false;
   }

   private void a() {
      for(int var1 = 0; var1 < this.y.length; ++var1) {
         Worksheet var2 = this.i.getWorksheets().get(var1);
         if (var2.isVisible()) {
            this.a(var2, var1);
         } else {
            Cells var3 = var2.getCells();
            var3.getRows().a(16);
            this.y[var1] = var3.getRows().a;
         }
      }

   }

   private void a(Worksheet var1, int var2) {
      Cells var3 = var1.getCells();
      var3.getRows().a(17);
      this.y[var2] = var3.getRows().a;
      var3.getRows().a(2, true);
      this.B[var1.getIndex()] = var3.getRows().b;
      this.A[var2] = new zkw(var3, 16383);
      var3.c = this.A[var2];
      this.z[var2] = new zkt(var3, 16383);
      var3.d = this.z[var2];
      if (var1.j() != null && var1.j().getCount() > 0) {
         this.f[var2] = new HashMap();
         var1.j().a();
      }

   }

   private void b() {
      for(int var3 = 0; var3 < this.y.length; ++var3) {
         Worksheet var1 = this.i.getWorksheets().get(var3);
         Cells var2 = var1.getCells();
         var2.getRows().a = this.y[var3];
         if (this.B[var3] != null) {
            var2.getRows().b = this.B[var3];
            var2.c = this.A[var3];
            var2.d = this.z[var3];
         }

         if (var1.j() != null && var1.j().getCount() > 0) {
            var1.j().b();
         }
      }

   }

   private void c() {
      for(int var2 = 0; var2 < this.y.length; ++var2) {
         Cells var1 = this.i.getWorksheets().get(var2).getCells();
         var1.getRows().a();
         if (this.B[var2] != null) {
            var1.getRows().b();
            var1.m();
            var1.l();
         }
      }

   }

   void a(ImageOrPrintOptions var1) throws Exception {
      this.d();
      new HashMap();
      this.o = this.i.getDefaultStyle();
      this.a();
      zsx var3 = new zsx(this.i, this);
      var3.e = this.a;

      for(int var4 = 0; var4 < this.y.length; ++var4) {
         var3.a(this.i.getWorksheets().get(var4), var1);
      }

      zaay var12 = zka.a(this.i);
      zxu var5 = new zxu();
      var5.a(new zhc(this.i, true));
      this.c = new ArrayList();
      int var6 = -1;
      int var7 = 1;

      for(int var8 = 0; var8 < var3.f.size(); ++var8) {
         zasn var9 = (zasn)var3.f.get(var8);
         Worksheet var10 = this.i.getWorksheets().get(var9.a);
         if (var10.m() != var6 && !var10.getPageSetup().isAutoFirstPageNumber()) {
            var7 = var10.getPageSetup().getFirstPageNumber();
         }

         zan var11 = new zan(var10, var9, var7, var3.f.size(), var3.f, var1, this, var8, var12, var5);
         ++var7;
         var6 = var10.m();
         com.aspose.cells.b.a.a.ze.a(this.c, (Object)var11);
      }

      this.c();
   }

   void a(Worksheet var1, ImageOrPrintOptions var2) throws Exception {
      this.d();
      new HashMap();
      this.o = this.i.getDefaultStyle();
      this.k = var1;
      this.a(var1, var1.getIndex());

      for(int var4 = 0; var4 < this.y.length; ++var4) {
         if (var4 != var1.getIndex()) {
            Cells var5 = this.i.getWorksheets().get(var4).getCells();
            var5.getRows().a(16);
            this.y[var4] = var5.getRows().a;
         }
      }

      zsx var13 = new zsx(this.i, this);
      var13.e = this.a;
      var13.a(var1, var2);
      zaay var14 = zka.a(var1);
      zxu var6 = new zxu();
      var6.a(new zhc(this.i, true));
      this.c = new ArrayList();
      int var7 = -1;
      int var8 = 1;

      for(int var9 = 0; var9 < var13.f.size(); ++var9) {
         zasn var10 = (zasn)var13.f.get(var9);
         Worksheet var11 = this.i.getWorksheets().get(var10.a);
         if (var11.m() != var7 && !var11.getPageSetup().isAutoFirstPageNumber()) {
            var8 = var11.getPageSetup().getFirstPageNumber();
         }

         zan var12 = new zan(var11, var10, var8, var13.f.size(), var13.f, var2, this, var14, var6);
         ++var8;
         var7 = var11.m();
         com.aspose.cells.b.a.a.ze.a(this.c, (Object)var12);
      }

      this.c();
   }

   void a(com.aspose.cells.b.a.d.zm var1) throws Exception {
      try {
         this.m = var1;
         this.e();
         if (this.m.e()) {
            this.m.a(0L, 0);
         }

         this.c = null;
      } catch (Exception var6) {
         com.aspose.cells.a.c.zl.b(var6);
         throw new CellsException(4, var6.getMessage());
      } finally {
         this.c();
      }

   }

   private void d() {
      HashMap var1 = new HashMap();
      Iterator var2 = this.i.getWorksheets().getNames().iterator();

      while(var2.hasNext()) {
         Name var3 = (Name)var2.next();
         var1.put(var3.getText(), var3);
      }

      this.r = new HashMap();

      for(int var7 = 0; var7 < this.i.getWorksheets().getCount(); ++var7) {
         Worksheet var8 = this.i.getWorksheets().get(var7);
         if (var8.getType() == 1 && var8.isVisible()) {
            for(int var4 = 0; var4 < var8.getHyperlinks().getCount(); ++var4) {
               Hyperlink var5 = var8.getHyperlinks().get(var4);
               this.a(var1, var5, var8);
            }

            Iterator var9 = var8.getShapes().iterator();

            while(var9.hasNext()) {
               Shape var10 = (Shape)var9.next();
               Hyperlink var6 = var10.getHyperlink();
               if (var6 != null) {
                  this.a(var1, var6, (Worksheet)null);
               }
            }
         }
      }

   }

   private void a(HashMap var1, Hyperlink var2, Worksheet var3) {
      if (this.r.get(var2) == null) {
         if (var2.getAddress() != null) {
            String var4 = var2.getAddress().toLowerCase();
            int var5 = -1;
            String var6 = var4;
            int var7 = var4.indexOf("!");
            if (var7 != -1) {
               String[] var8 = com.aspose.cells.b.a.zv.d(var4, '!');
               String var9 = var8[0];
               var6 = var4.substring(var7 + 1);
               if (var9.charAt(0) == '\'') {
                  var9 = var9.substring(1, 1 + (var9.length() - 2));
               }

               Worksheet var10 = this.i.getWorksheets().get(var9);
               if (var10 != null) {
                  var5 = var10.getIndex();
               }

               if (var8[1] != null && !"".equals(var8[1]) && var8[1].indexOf(":") == -1) {
                  byte var11 = 0;
                  byte var12 = 0;
                  if (var10 != null && zakq.d(var8[1]) && var10 != null) {
                     try {
                        var8[1] = com.aspose.cells.b.a.zv.a(var8[1], "$", "");
                        int[] var13 = new int[]{var11};
                        int[] var14 = new int[]{var12};
                        CellsHelper.a(var8[1], var13, var14);
                        int var27 = var13[0];
                        int var28 = var14[0];
                        Cell var15 = var10.getCells().a(var27, var28, false);
                        this.r.put(var2, var15);
                        if (var3 != null) {
                           RowCollection var16 = var3.getCells().getRows();
                           CellArea var17 = var2.getArea();
                           int var18 = var17.EndRow;
                           int var19 = var17.StartColumn;
                           int var20 = var17.EndColumn;

                           for(var27 = var17.StartRow; var27 <= var18; ++var27) {
                              Row var21 = var16.a(var27, false, true, false);

                              for(var28 = var19; var28 <= var20; ++var28) {
                                 var21.c(var28);
                              }
                           }
                        }

                        return;
                     } catch (Exception var22) {
                        ;
                     }
                  }
               }
            }

            var7 = this.i.getWorksheets().getNames().a(var6, var5, true);
            if (var7 != -1) {
               Name var23 = this.i.getWorksheets().getNames().get(var7);
               Range[] var24 = var23.getRanges();
               if (var24 == null || var24.length == 0) {
                  return;
               }

               Range var25 = var24[0];
               var7 = var25.getWorksheet().getIndex();
               Cell var26 = this.i.getWorksheets().get(var7).getCells().a(var25.getFirstRow(), var25.getFirstColumn(), false);
               if (this.r.get(var2) == null) {
                  this.r.put(var2, var26);
               }
            }

         }
      }
   }

   private void e() throws Exception {
      PdfSaveOptions var1 = (PdfSaveOptions)this.i.getSaveOptions();
      this.b = var1.a;
      this.b.a(var1.g);
      this.b.d(var1.f);

      try {
         this.b.c((String)this.i.getBuiltInDocumentProperties().get("Author").getValue());
         this.b.b((String)this.i.getBuiltInDocumentProperties().get("Title").getValue());
         this.b.a((String)this.i.getBuiltInDocumentProperties().get("Subject").getValue());
         this.b.d((String)this.i.getBuiltInDocumentProperties().get("Keywords").getValue());
      } catch (Exception var14) {
         ;
      }

      this.w = new zatn();
      ImageOrPrintOptions var2 = var1.b;
      var2.setWarningCallback(var1.getWarningCallback());
      this.a = new com.aspose.cells.a.d.zeq(this.w, this.b, var2.e());
      this.a.e = var1.getImageType();
      this.d();

      Worksheet var4;
      int var5;
      for(int var3 = 0; var3 < this.y.length; ++var3) {
         var4 = this.i.getWorksheets().get(var3);
         if (var4.isVisible() && var4.getPivotTables() != null && var4.getPivotTables().getCount() > 0) {
            for(var5 = 0; var5 < var4.getPivotTables().getCount(); ++var5) {
               if (var4.isVisible() && !var4.getPivotTables().get(var5).ah) {
                  var4.getPivotTables().get(var5).a();
               }
            }
         }
      }

      this.a();
      new HashMap();
      this.a(this.b.j());
      this.o = this.i.getDefaultStyle();
      if (this.b.q() != null) {
         this.b.a(new com.aspose.cells.a.d.zet(((com.aspose.cells.a.d.zeq)this.a).c(), this.b.q()));
         this.b.p().d();
      }

      zsx var15 = new zsx(this.i, this);
      var15.e = this.a;

      for(var5 = 0; var5 < this.y.length; ++var5) {
         Worksheet var6 = this.i.getWorksheets().get(var5);
         if (var6.isVisible()) {
            var15.a(var6, var2);
         }
      }

      zaay var16 = zka.a(this.i);
      zxu var17 = new zxu();
      var17.a(new zhc(this.i, true));
      int var7 = -1;
      int var8 = -1;
      int var9 = 1;

      for(int var10 = 0; var10 < var15.f.size() && var10 - var2.e() < var2.f(); ++var10) {
         zasn var11 = (zasn)var15.f.get(var10);
         if (var11.a != var7 && var7 != -1) {
            this.a.b();
         }

         if (var11.a == var7 && var8 != -1 && var11.b != -1 && var11.b != var8) {
            this.a.b();
         }

         if (var10 % 200 == 0 && var10 != 0) {
            long var12 = com.aspose.cells.b.a.zg.a(false);
            if (var12 - this.C > 100000000L) {
               this.C = var12;
               com.aspose.cells.b.a.zg.a();
               com.aspose.cells.b.a.zg.b();
            }
         }

         Worksheet var18 = this.i.getWorksheets().get(var11.a);
         if (var11.a != var7 && !var18.getPageSetup().isAutoFirstPageNumber()) {
            var9 = var18.getPageSetup().getFirstPageNumber();
         }

         zan var13 = new zan(var18, var11, var9, var15.f.size(), var15.f, var2, this, var10, var16, var17);
         ++var9;
         var13.o = this.r;
         var13.s = this.v;
         var13.r = this.u;
         var13.q = this.t;
         var13.p = this.s;
         this.a.a(var18.getPageSetup().getBlackAndWhite() || var2 != null && var2.e);
         this.a.a((com.aspose.cells.a.d.zl)var13);
         var7 = var11.a;
         var8 = var11.b;
         this.w.a(this.m);
         this.w.b_();
         this.i.l();
         var13 = null;
      }

      if (var15.f.size() == 0) {
         this.a((com.aspose.cells.a.d.zeq)this.a);
      }

      this.f();
      this.g();
      this.a.a();
      this.w.a(this.m);
      this.w.a();
      this.w = null;
      var4 = null;
      this.a = null;
   }

   private void a(com.aspose.cells.a.d.zeq var1) throws Exception {
      com.aspose.cells.a.d.zm var2 = null;
      double var3 = 595.2755905511812D;
      double var5 = 841.8897637795276D;
      if (this.i != null && this.i.getWorksheets().getCount() > 0) {
         PageSetup var7 = this.i.getWorksheets().get(0).getPageSetup();
         double[] var8 = new double[]{var3};
         double[] var9 = new double[]{var5};
         zatm.a(var7, var8, var9);
         var3 = var8[0];
         var5 = var9[0];
         var3 *= 72.0D;
         var5 *= 72.0D;
      }

      var2 = new com.aspose.cells.a.d.zm((float)var3, (float)var5);
      this.a.a((com.aspose.cells.a.d.zl)var2);
   }

   private void f() {
      if (this.a instanceof com.aspose.cells.a.d.zeq && this.u != null && this.u.size() > 0) {
         Iterator var1 = this.u.keySet().iterator();

         while(true) {
            Object var2;
            Cell var3;
            String var7;
            do {
               do {
                  if (!var1.hasNext()) {
                     return;
                  }

                  var2 = var1.next();
                  var3 = (Cell)this.u.get(var2);
                  var7 = (String)this.t.get(var3);
               } while(var7 == null);
            } while(var7.length() <= 0);

            String[] var8 = com.aspose.cells.b.a.zv.d(var7, '_');
            int var4 = com.aspose.cells.b.a.zo.a(var8[0]);
            float var5 = Float.parseFloat(var8[1]);
            float var6 = Float.parseFloat(var8[2]);
            com.aspose.cells.a.d.zi var9 = (com.aspose.cells.a.d.zi)this.s.get(var2);
            Iterator var10 = ((com.aspose.cells.a.d.zeq)this.a).c().f().a.iterator();

            while(var10.hasNext()) {
               com.aspose.cells.a.d.zdb var11 = (com.aspose.cells.a.d.zdb)var10.next();
               if (com.aspose.cells.b.a.zv.b(var11.b(), var9.c())) {
                  var11.a((String)this.t.get(var3));
               }
            }

            (new StringBuilder()).append("").append(var9.c()).toString();
            var9.a((String)this.t.get(var3));
            ((com.aspose.cells.a.d.zeq)this.a).c().f().b.put(var9.c(), new com.aspose.cells.a.d.zdj(var4, new com.aspose.cells.b.a.b.zo(var5, var6)));
         }
      }
   }

   private void g() throws Exception {
      if (this.b.j() != null) {
         this.a((PdfBookmarkEntry)this.b.j(), 0);
      }
   }

   private void a(PdfBookmarkEntry var1) {
      if (var1 != null) {
         this.v.put(var1, (Object)null);
         if (var1 != null && var1.getSubEntry() != null && var1.getSubEntry().size() > 0) {
            Iterator var2 = var1.getSubEntry().iterator();

            while(var2.hasNext()) {
               PdfBookmarkEntry var3 = (PdfBookmarkEntry)var2.next();
               this.a(var3);
            }
         }

      }
   }

   private void a(PdfBookmarkEntry var1, int var2) throws Exception {
      if (var1 != null) {
         com.aspose.cells.a.d.zdj var3 = new com.aspose.cells.a.d.zdj(var1.a, var1.b);
         if (var1.getText() != null && var1.getText().length() != 0) {
            if (!var1.a()) {
               return;
            }

            ((com.aspose.cells.a.d.zeq)this.a).c().g().a(var1.getText(), var2, var3, var1.isOpen());
         } else {
            --var2;
         }

         if (var1.getSubEntry() != null && var1.getSubEntry().size() > 0) {
            ++var2;
            Iterator var4 = var1.getSubEntry().iterator();

            while(var4.hasNext()) {
               PdfBookmarkEntry var5 = (PdfBookmarkEntry)var4.next();
               this.a(var5, var2);
            }
         }
      }

   }
}
